<?php include_partial('shopCartAdminProducts/messages') ?>
<h3 class="float:left;">Products List</h3> 
<a title="" href="<?php echo url_for('shopCartAdminProducts/new') ?>" class="addProduct right button noClear">Add product</a>


<table class="table table-bordered table-striped adminGrid">
    <thead>
        <tr>
            <th width="10%">Image</th>
            <th width="20%">Title</th>
            <th width="40%">Description</th>
            <th width="15%">Price</th>
            <th width="10%">Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php $products = $pager->getResults() ?>
        <?php foreach ($products as $product): ?>
            <tr>
                <td >            
                    <img src="/<?php echo sfConfig::get('app_product_dir_images') . '/' . $product->getImage() ?>" alt="" width="100" height="90" class="img-rounded" />
                </td>

                <td ><a href="<?php echo url_for('shopCartAdminProducts/show?id=' . $product->getId()) ?>"><?php echo $product->getTitle() ?></a></td>
                <td><?php echo $product->getDescription() ?></td>
                <td>$ <?php echo $product->getPrice() ?></td>
                <td class="actions">
                    <ul class="actions">
                        <li>
                            <a class="edit" href="<?php echo url_for('shopCartAdminProducts/edit?id=' . $product->getId()) ?>"> </a>
                        </li>
                        <li>                    
                            <?php
                            echo link_to(' ', 'shopCartAdminProducts/delete?id=' . $product->getId(), array(
                                'method'  => 'delete',
                                'confirm' => 'Do you really want to delete the product??',
                                'title'   => 'Delete',
                                'class'   => 'deleteUser delete '
                            ))
                            ?>
                        </li>
                    </ul>
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php include_partial('shopCartAdminProducts/pager', array('pager'     => $pager, 'routeName' => 'shopCartAdminProducts/index')) ?>


